<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*,com.base.utils.*,java.io.*"%>
<%@ page import="com.base.attachment.entity.Attachment,com.base.attachment.service.IAttachmentDAO"%>
<%@ page import="com.base.attachment.service.IAttachmentStorer,com.base.commons.SpringBeanHolder"%>
<%
	//String beanId = request.getParameter("beanId");
String id = request.getParameter("id");
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
StringBuilder stb = new StringBuilder();
     try {
          if(id!=null&&!"".equals(id)){
				IAttachmentDAO attachmentDAO = SpringBeanHolder
						.getBean("attachmentDAO");
				Attachment attach = attachmentDAO.get(id);
				IAttachmentStorer attachmentStorer = SpringBeanHolder
						.getBean("attachmentStorer");
				InputStream is = attachmentStorer.downloadAttachment(attach);

				
				BufferedReader br = new BufferedReader(new InputStreamReader(
						is, "utf-8"));
				String data = "";
				while ((data = br.readLine()) != null) {
					stb.append(data);
				}
				br.close();
              }
		} catch (Exception e) {
				e.printStackTrace();
		}
%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>应急流程</title>
<style type="text/css">
	v\:*{BEHAVIOR: url(#default#VML)}
</style>
<link rel="stylesheet" type="text/css" href="../../../css/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="design.css" />
<script type="text/javascript" src="../../../js/ext-base.js"></script>
<script type="text/javascript" src="../../../js/ext-all.js"></script>
<script type="text/javascript">
  var beanId = '<%=request.getParameter("beanId")%>';
  var bPath='<%=basepath%>';
  var processXml='<%=stb.toString()%>';
</script>
<script type="text/javascript" src="designConfigt.js"  charset="utf-8"></script>
<script>
   // alert(beanId);
	Ext.onReady(function(){
		DesignConfig.init();
		if(processXml!=''){
		  //表示是编辑
		  XmlToProcess(processXml);
		}
	});
</script>
</head>
<body onContextMenu="return false">
<div id="west" style="display:none">
	<div title="select" class="btn btn_down"><span class="icon_select">选择</span></div>
	<div title="transition" class="btn btn_up_split"><span class="icon_transtion">转换</span></div>
	<div title="start" class="btn btn_up"><span class="icon_start">开始</span></div>
	<div title="end" class="btn btn_up_split"><span class="icon_stop">结束</span></div>
	<div title="task" class="btn btn_up"><span class="icon_task">步骤</span></div>
	<div title="state" class="btn btn_up"><span class="icon_method">措施</span></div>
</div>
<div id="center"></div>
<div id="south_key" style="display:none">
	<div title="base" class="key_btn key_btn_up key_btn_down"><span class="icon_base">基本信息</span></div>
	<div title="delegate" class="key_btn key_btn_up"><span class="icon_delegate">任务委派</span></div>
	<div title="autoDelegate" class="key_btn key_btn_up"><span class="icon_delegate">动态委派</span></div>
	<div title="form" class="key_btn key_btn_up"><span class="icon_form">业务信息</span></div>
	<div title="base" class="key_split"></div>
</div>
<div id="south_value"></div>
</body>
</html>